<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>时间戳的获取与使用</title>
</head>
<body>
    <script>
        const date = new Date()
        // 时间戳的获取
        console.log(date.getTime());
        console.log(+ new Date());
        console.log(Date.now());

        // 获取指定时间的时间戳
        console.log(+ new Date('2021-3-7 0:0:0'));
    </script>
</body>
</html>